{extend name='template/base'}{/extend}
{block name='title'}{/block}
{block name='style'}
<style>
    .edit-content img{
        max-width: 100%;
    }
</style>
{/block}
{block name='script'}{/block}
{block name='footer'}{/block}
{block name='content'}
    <header class="header">
        <div>
            <a class="back"><i class="iconfont icon-zuoyoujiantou-copy-copy-copy"></i></a>
            商品详情
        </div>
    </header>
    <div class="pages" >
        <!-- Swiper -->
        <div class="swiper-container">
            <div class="swiper-wrapper">
                {volist name="slide_image" id="vo"}
                <div class="swiper-slide">
                    <!--<a href=""><img src="../../../../public/wechat/static/image/fs.png"/></a>-->
                    <a ><img src="{$vo}"/></a>
                </div>
                {/volist}
                <!--<div class="swiper-slide">-->
                <!--<a href=""><img src="../../../../public/wechat/static/image/fs.png"/></a>-->
                <!--</div>-->
            </div>
            <!-- Add Pagination -->
            <div class="swiper-pagination"></div>
        </div>
        <div id="data_ul">

            <div class="list-form other">
                <ul >
                    <li>
                        <h4>{$info.name}</h4>
                        <p>
                            <b class="color-primary">￥{$info.price}</b>
                            <!--<span class="font12">月售185</span>-->
                        </p>
                        <!--<div class="absmiddle-right"><a class="btn color-primary">加入购物车</a></div>-->
                        <div class="count">
                            {if condition="($info.is_work==1)"}
                            <span @tap="down_tap({$info.v_price},{$info.id},{$info.v_flag})" {if condition='$info.quantity>0' } style="display: inline;" {/if} class="down"><i class="iconfont icon-wuuiconsuoxiao"></i></span>
                            <input type="tel" readonly {if condition='$info.quantity>0' } style="display: inline;" {/if} class="num" value="{$info.quantity}" maxlength="3">
                            <span @tap="up_tap({$info.price},{$info.id},{$info.v_flag},'{$info.name}')" class="up"><i class="iconfont icon-wuuiconxiangjifangda"></i></span>
                            {else /}
                            <span  class="down" style="display: block;"> <i class="iconfont icon-wuuiconxiangjifangda"></i></span>
                            {/if}
                        </div>
                    </li>

                    <ul>
                        <li><b>商品介绍</b></li>
                        <li class="edit-content ">
                            <p class="font12">
                                {$info.detail}
                            </p>
                        </li>
                    </ul>

                </ul>
                <!--评价-->
                <!--<ul>-->
                <!--<li>商品评价（好评率：100%）</li>-->
                <!--<li class="goods-list">-->
                <!--<ul>-->
                <!--<li>-->
                <!--<div class="img"><img src="../../../../public/wechat/static/image/timo.jpg" height="441" width="500"/></div>-->
                <!--<div class="text">-->
                <!--<div class="title">匿名用户</div>-->
                <!--<p class="ellipsis">好吃，很好吃，好吃上瘾!好吃，很好吃，好吃上瘾!好吃，很好吃，好吃上瘾!</p>-->
                <!--</div>-->
                <!--</li>-->
                <!--<li>-->
                <!--<div class="img"><img src="../../../../public/wechat/static/image/timo.jpg" height="441" width="500"/></div>-->
                <!--<div class="text">-->
                <!--<div class="title">匿名用户</div>-->
                <!--<p class="ellipsis">好吃，很好吃，好吃上瘾!好吃，很好吃，好吃上瘾!好吃，很好吃，好吃上瘾!</p>-->
                <!--</div>-->
                <!--</li>-->
                <!--<li>-->
                <!--<div class="img"><img src="../../../../public/wechat/static/image/timo.jpg" height="441" width="500"/></div>-->
                <!--<div class="text">-->
                <!--<div class="title">匿名用户</div>-->
                <!--<p class="ellipsis">好吃，很好吃，好吃上瘾!好吃，很好吃，好吃上瘾!好吃，很好吃，好吃上瘾!</p>-->
                <!--</div>-->
                <!--</li>-->
                <!--</ul>-->
                <!--</li>-->
                <!--</ul>-->
            </div>
            {if condition="($info.is_work==1)"}
            <div class="foot-btn">
                <div style="padding:0;">
                    <!--<a href="{:url('/cart/Cart/index')}"> <i class="iconfont icon-gouwuche"></i></a>-->
                    <!--<span id="total_price">总价：0元</span>-->
                    <!--<a @tap="send_btn({$info.store_id})"  class="btn">去结算</a>-->


                    <!--<a href="{:url('shop/Shop/index')}" style="display:inline-block;-->
                    <!--height: 45px;width: 50%;margin-left: -15px; line-height: 45px; padding: 0 20px;-->
                    <!--background: #E76E70;color: #fff;text-align:center;box-sizing: border-box;-->
                    <!--border-radius:100px;font-size: 12px;">返回首页继续购买</a>-->
                    <!--<a href="{:url('/cart/Cart/index')}" style="display:inline-block;-->
                    <!--height: 45px;width: 50%;margin-right: -15px; line-height: 45px; padding: 0 20px;-->
                    <!--background: #FD2A4A;color: #fff;text-align:center;box-sizing: border-box;-->
                    <!--border-radius:100px;float: right;font-size: 12px;">去结算-->
                        <!--(<span id="total_price">{$total_price}元</span>）</a>-->

                    <a href="{:url('shop/Shop/index')}" style="display: inline-block;width: 50%;height: 45px;line-height:45px;background: #E76E70;text-align:center;color: #fff;float: left;">返回首页继续购买</a>
                    <a href="{:url('/cart/Cart/index')}" style="display: inline-block;width: 50%;height: 45px;line-height:45px;background: #FD2A4A;text-align:center;color: #fff;float: left;">去结算(<span id="total_price">{$total_price}元</span>)</a>
                </div>
            </div>
            {else /}
            <div  class="foot-btn color-gray">
                <div class="text-center" style="color: white;background-color: grey">
                    商家休息，停止接单
                </div>
            </div>
            {/if}
        </div>


        <div class="popups-module">
            <div class="popups-module-wrap" id="popups">
                <div class="popups-module-box">
                    <!--<a class="btn">关闭</a>-->
                    <div class="specification">
                        <div class="title">{{v_goods_name}}</div>
                        <p>规格</p>
                        <ul class="box">
                            <template v-for="(item, index) in v_items">
                                <li v-bind:class="[index==a_index? 'active' : '']" @tap="variant(item.id,item.price,index)">
                                    {{item.name}}
                                </li>
                            </template>
                        </ul>
                    </div>
                </div>
                <div class="popups-module-footer">
                    <div class="specification">
                        <div class="price">
                            <span>￥{{v_price}}</span>
                            <a @tap="save_variant()" class="btn">确定</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{/block}
{block name='script_extra'}
<script>
    var cart_url = "{:url('cart/Cart/have_cart')}";
    var send_order_url = "{:url('order/Order/send_order')}";
    var variant_url = "{:url('shop/Goods/get_variant')}";
    var add_cart_url = "{:url('cart/Cart/add_cart')}";
    var goods_url = "{:url('shop/Goods/index')}";
    var list_url = "{:url('shop/Goods/detail')}";
    var total_price = "{$total_price}";
    var store_id = "{$store_id}";
    document.querySelector('.back').addEventListener('tap', function () {
        window.location.href= goods_url+"/store_id/"+store_id;
    });
    require(['goods/detail']);
</script>
{/block}